<template>
  <section>
    <flow-designer :flow-id="curFlowID" :operate="operate"></flow-designer>
  </section>
</template>

<script>
import _ from "lodash";
export default {
  name: "flowDesign",
  data() {
    return {};
  },
  created() {
    console.log("00000000000000");
  },
  mounted() {
    this.checkLoginOut();
  },
  computed: {
    curFlowID() {
      let flowId = this.$route.query.flowId;
      if (flowId) {
        return flowId;
      } else {
        return 0;
      }
    },
    operate() {
      let operate = this.$route.query.operate;
      console.log(operate);
      if (operate) {
        return operate;
      } else {
        return "create";
      }
    }
  },
  methods: {
    checkLoginOut() {
      let code = setInterval(() => {
        let clearInfo = window.localStorage.getItem("clearInfo");
        console.log(clearInfo);
        if (clearInfo === "clear") {
          window.localStorage.setItem("clearInfo", null);
          clearInterval(code);
          this.closeWindow();
        }
      }, 1000);
    },
    onEditorArticleClose() {
      this.closeWindow();
    },
    // 关闭
    closeWindow() {
      window.localStorage.setItem("refresh", "666");
      window.close();
    }
  },
  components: {}
};
</script>

<style scoped lang="less">
@import "../../../styles/flex-layout.less";
.report_dialog {
  /deep/ .el-tree-node {
    margin: 10px 0px;
  }
  /deep/ .el-dialog__header {
    display: none;
  }
  /deep/ .el-dialog__body {
    padding: 0px;
  }
  z-index: 2501 !important;
}
</style>
